package com.rd.student.jiaji.class3.wangyanbo.day0731;

import java.util.HashSet;

public class Test2 {
    public static void main(String[] args) {
        int[] a=new int[50];
        for (int i = 0; i < 50; i++) {
            a[i]=i;
        }

        HashSet hashSet=new HashSet();
        while(hashSet.size()<20){
            int random = (int) (Math.random() * 50);
            hashSet.add(a[random]);
        }
        System.out.println(hashSet);
    }
}
